package com.bcbim.model_server_interface.component.vo;

import com.bcbim.model_server_interface.component.bo.ComponentInfoBO;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.Map;

/**
 * @Description: 构件信息
 * @Author: ye
 * @Date: 2022/4/29
 * @Version: V1.0
 **/
@Data
public class ComponentInfoVO implements Serializable {
    /**
     * id
     */
    private String id;
    /**
     * revitId
     */
    private String revitId;
    /**
     * 楼层id
     */
    private String floorId;
    /**
     * 构件名
     */
    private String componentName;
    /**
     * 类别
     */
    private String category;

    private Map<String, String> param;

    public ComponentInfoVO() {

    }

    public ComponentInfoVO(ComponentInfoBO info) {
        if (StringUtils.isNotEmpty(info.getId())) {
            this.id = info.getId();
        }
        if (StringUtils.isNotEmpty(info.getCategory())) {
            this.category = info.getCategory();
        }
        if (StringUtils.isNotEmpty(info.getComponentName())) {
            this.componentName = info.getComponentName();
        }
        if (StringUtils.isNotEmpty(info.getFloorId())) {
            this.floorId = info.getFloorId();
        }
        if (StringUtils.isNotEmpty(info.getRevitId())) {
            this.revitId = info.getRevitId();
        }
    }
}
